<template>
	<view>
		<cu-custom :bgColor="globalData.bgColor" :isBack="true">
			<template #content>
				<text class="text-darkgrey">{{ $t('order.list.ei61mf') }}</text>
			</template>
		</cu-custom>
		<form>
			<view class="cu-form-group solid-top">
				<view class="title text-darkgrey cuIcon-notice">
					<text class="margin-left-xs">{{ $t('setting.index.z8265q') }}</text>
				</view>
				<switch @change="noticeSoundChange" :class="userSetting.noticeSound ? 'checked' : ''" :checked="userSetting.noticeSound ? true : false"></switch>
			</view>
			<navigator class="cu-form-group" url="log-list" v-show="globalData.isDev">
				<view class="title text-darkgrey cuIcon-info">
					<text class="margin-left-xs">{{ $t('setting.index.52id71') }}</text>
				</view>
			</navigator>
		</form>
	</view>
</template>

<script>
import service from '@/store/service'; //存储相关数据服务util

export default {
	onLoad() {
		this.userSetting = service.getUserSetting();
	},
	data() {
		return {
			globalData: getApp().globalData,
			userSetting: {
				//设置信息
				noticeSound: true //是否开启声音通知
			}
		};
	},
	methods: {
		noticeSoundChange: function (e) {
			this.userSetting.noticeSound = e.detail.value;
			service.saveUserSetting(this.userSetting);
		}
	}
};
</script>

<style></style>
